/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * FrmDendaBuku.java
 *
 * Created on 02 Des 12, 16:32:43
 */

package sistemperpustakaan.view.denda;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JTextField;
import sistemperpustakaan.controller.DendaController;
import sistemperpustakaan.model.DendaModel;
import sistemperpustakaan.view.FrmMain;

/**
 *
 * @author EKo
 */
public class FrmDendaBuku extends javax.swing.JInternalFrame {
FrmMain frameMain;
DendaController controller;
DendaModel model;
    /** Creates new form FrmDendaBuku */
    public FrmDendaBuku(FrmMain main) {
        //super(parent, modal);
        this.frameMain = main;
        controller = new DendaController(this);
        model = new DendaModel();
        controller.setModel(model);
//        setSize(800, 600);
//        System.out.println("Hello");
        initComponents();
        setTitle("Setting Denda");
        controller.showDendaBuku();
        SetButton();
    }

    public JTextField getTxtDendaBuku() {
        return txtDendaBuku;
    }

    public void setTxtDendaBuku(JTextField txtDendaBuku) {
        this.txtDendaBuku = txtDendaBuku;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        gbr = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        txtDendaBuku = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        btnSave = new javax.swing.JButton();

        setClosable(true);
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        gbr.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sistemperpustakaan/image/denda.png"))); // NOI18N
        getContentPane().add(gbr, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 30, 120, 155));

        jLabel1.setText("Rp.");
        getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 50, -1, -1));
        getContentPane().add(txtDendaBuku, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 50, 160, -1));

        jLabel2.setText("/ Buku");
        getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(200, 50, -1, -1));

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel3.setText("Setting Denda Buku");
        getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, -1, -1));

        btnSave.setText("SAVE");
        getContentPane().add(btnSave, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 80, -1, -1));

        pack();
    }// </editor-fold>//GEN-END:initComponents


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnSave;
    private javax.swing.JLabel gbr;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JTextField txtDendaBuku;
    // End of variables declaration//GEN-END:variables

    private void SetButton() {
        btnSave.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                controller.UpdateDendaBuku();
            }
        });
    }

}
